import 'package:auto_route/auto_route.dart';
import 'package:flutter/cupertino.dart';

///使用fluro进行路由管理
class LRouter {
  static void init() {
    // configureRoutes(router);
  }

  ///路由配置
  // static void configureRoutes(Router router) {
  //    router.notFoundHandler = Handler(
  //        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  //          print("route is not find !");
  //          return null;
  //        });

  //网页加载
  // router.define('/web', handler: Handler(
  //     handlerFunc: (BuildContext context, Map<String, List<String>> params) {
  //       String title = params['title']?.first;
  //       String url = params['url']?.first;
  //       return WebViewPage(url, title);
  //     }));
  // }
  static ExtendedNavigatorState navigatorCtx(BuildContext context) =>
      ExtendedNavigator.of(context);

  static ExtendedNavigatorState get navigator => ExtendedNavigator.root;

  static List<ExtendedNavigatorState> get navigatorChildrens =>
      ExtendedNavigator.root.children;
}
